import re

def sorted(fname: str)-> list:
    ''' sanitized list , '''
    scores = []
    raw_scores = []
    try:
        with open(fname) as f:
            for each_line in f :
                raw_scores.extend(re.split(r'[,+ \t]',each_line.strip()))
            scores = [re.sub('[-.]', ':', s) for s in raw_scores ]                 
    except IOError as err:
        print("sorted:",err)
    print("\nbefore sorted:", raw_scores)
    scores.sort()
    print("after sorted:", scores)
    return scores

james = sorted('./ch05/data/james.txt')
print("James: ", james)

julie = sorted('./ch05/data/julie.txt')
print("julia: ", julie)

mikey = sorted('./ch05/data/mikey.txt')
print('mikey: ', mikey)

sarah = sorted('./ch05/data/sarah.txt')
print('sarah: ', sarah)


